import { createApp } from 'vue'
import { createPinia, type Pinia } from 'pinia'
import persisted from "pinia-plugin-persistedstate";
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import "@/assets/main.scss";
import "nprogress/nprogress.css"

const app = createApp(App);
app.use(ElementPlus);
const pinia: Pinia = createPinia();
// 全局状态管理持久化插件
pinia.use(persisted);
app.use(pinia)
app.use(router)


// 全局注册plus插件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.mount('#app')